using System;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using Oracle.ManagedDataAccess.Client;
using OracleInternal.Common;

namespace Oracle.ManagedDataAccess.Types
{
	[Serializable]
	[XmlSchemaProvider("GetXsdType")]
	public struct OracleString : IComparable, INullable, IXmlSerializable
	{
		private string m_value;

		private bool m_bNotNull;

		private bool m_bCaseIgnored;

		public static readonly OracleString Null;

		public bool IsNull => !m_bNotNull;

		public char this[int index]
		{
			get
			{
				if (m_bNotNull)
				{
					return m_value.ToCharArray()[index];
				}
				throw new OracleNullValueException();
			}
		}

		public int Length
		{
			get
			{
				if (m_bNotNull)
				{
					return m_value.Length;
				}
				throw new OracleNullValueException();
			}
		}

		public string Value
		{
			get
			{
				if (m_bNotNull)
				{
					return m_value;
				}
				throw new OracleNullValueException();
			}
		}

		public bool IsCaseIgnored
		{
			get
			{
				return m_bCaseIgnored;
			}
			set
			{
				m_bCaseIgnored = value;
			}
		}

		public OracleString(string data)
			: this(data, isCaseIgnored: true)
		{
		}

		public OracleString(string data, bool isCaseIgnored)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
			}
			if (data != null)
			{
				m_bNotNull = true;
				m_value = data;
			}
			else
			{
				m_bNotNull = false;
				m_value = null;
			}
			m_bCaseIgnored = isCaseIgnored;
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
			}
		}

		public OracleString(byte[] bytes, bool isUnicode)
			: this(bytes, isUnicode, isCaseIgnored: true)
		{
		}

		public OracleString(byte[] bytes, bool isUnicode, bool isCaseIgnored)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
			}
			try
			{
				m_value = null;
				if (bytes == null)
				{
					throw new ArgumentNullException("bytes");
				}
				if (!isUnicode)
				{
					CultureInfo currentCulture = CultureInfo.CurrentCulture;
					m_value = Encoding.GetEncoding(currentCulture.TextInfo.ANSICodePage).GetString(bytes);
				}
				else
				{
					Decoder decoder = Encoding.Unicode.GetDecoder();
					char[] array = new char[decoder.GetCharCount(bytes, 0, bytes.Length)];
					decoder.GetChars(bytes, 0, bytes.Length, array, 0);
					m_value = new string(array);
				}
				m_bCaseIgnored = isCaseIgnored;
				m_bNotNull = true;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
				}
			}
		}

		public OracleString(byte[] bytes, int index, int count, bool isUnicode)
			: this(bytes, index, count, isUnicode, isCaseIgnored: true)
		{
		}

		public OracleString(byte[] bytes, int index, int count, bool isUnicode, bool isCaseIgnored)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
			}
			try
			{
				m_value = null;
				if (bytes == null)
				{
					throw new ArgumentNullException("bytes");
				}
				if (count < 0)
				{
					throw new ArgumentOutOfRangeException("count");
				}
				if (index < 0 || index >= bytes.Length)
				{
					throw new ArgumentOutOfRangeException("index");
				}
				if (!isUnicode)
				{
					CultureInfo currentCulture = CultureInfo.CurrentCulture;
					if (bytes.Length - index < count)
					{
						m_value = Encoding.GetEncoding(currentCulture.TextInfo.ANSICodePage).GetString(bytes, index, bytes.Length - index);
					}
					else
					{
						m_value = Encoding.GetEncoding(currentCulture.TextInfo.ANSICodePage).GetString(bytes, index, count);
					}
				}
				else
				{
					if (bytes.Length < count * 2)
					{
						count = bytes.Length / 2;
					}
					Decoder decoder = Encoding.Unicode.GetDecoder();
					int charCount = decoder.GetCharCount(bytes, index, count);
					char[] array = new char[charCount];
					charCount = decoder.GetChars(bytes, index, count, array, 0);
					if (count < charCount)
					{
						array[count] = '\0';
					}
					m_value = new string(array);
				}
				m_bCaseIgnored = isCaseIgnored;
				m_bNotNull = true;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
				}
			}
		}

		public static XmlQualifiedName GetXsdType(XmlSchemaSet schemaSet)
		{
			return new XmlQualifiedName("string", "http://www.w3.org/2001/XMLSchema");
		}

		XmlSchema IXmlSerializable.GetSchema()
		{
			return null;
		}

		void IXmlSerializable.ReadXml(XmlReader reader)
		{
			string attribute = reader.GetAttribute("null", "http://www.w3.org/2001/XMLSchema-instance");
			if (attribute == null || !XmlConvert.ToBoolean(attribute))
			{
				m_value = reader.ReadElementString();
				m_bNotNull = true;
			}
			else
			{
				m_value = null;
				m_bNotNull = false;
			}
			m_bCaseIgnored = true;
		}

		void IXmlSerializable.WriteXml(XmlWriter writer)
		{
			if (m_bNotNull)
			{
				writer.WriteString(m_value);
			}
			else
			{
				writer.WriteAttributeString("xsi", "null", "http://www.w3.org/2001/XMLSchema-instance", "true");
			}
		}

		public OracleString Clone()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.Clone);
			}
			try
			{
				return new OracleString(m_value, m_bCaseIgnored);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.Clone, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.Clone);
				}
			}
		}

		public int CompareTo(object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.CompareTo);
			}
			try
			{
				if (obj == null)
				{
					throw new ArgumentNullException("obj");
				}
				if (obj.GetType() != typeof(OracleString))
				{
					throw new ArgumentException("obj");
				}
				return StringCompare(this, (OracleString)obj);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.CompareTo, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.CompareTo);
				}
			}
		}

		public override bool Equals(object obj)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.Equals);
			}
			try
			{
				if (obj == null || obj.GetType() != typeof(OracleString))
				{
					return false;
				}
				return Equals(this, (OracleString)obj);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.Equals, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.Equals);
				}
			}
		}

		public override int GetHashCode()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.GetHashCode);
			}
			try
			{
				if (m_bNotNull)
				{
					return m_value.GetHashCode();
				}
				return 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.GetHashCode);
				}
			}
		}

		public byte[] GetNonUnicodeBytes()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.GetNonUnicodeBytes);
			}
			try
			{
				if (m_bNotNull)
				{
					return Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage).GetBytes(m_value);
				}
				throw new OracleNullValueException();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.GetNonUnicodeBytes, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.GetNonUnicodeBytes);
				}
			}
		}

		public byte[] GetUnicodeBytes()
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.GetUnicodeBytes);
			}
			try
			{
				if (m_bNotNull)
				{
					Encoder encoder = Encoding.Unicode.GetEncoder();
					char[] array = m_value.ToCharArray();
					byte[] array2 = new byte[encoder.GetByteCount(array, 0, array.Length, flush: true)];
					encoder.GetBytes(array, 0, array.Length, array2, 0, flush: true);
					return array2;
				}
				throw new OracleNullValueException();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.GetUnicodeBytes, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.GetUnicodeBytes);
				}
			}
		}

		public override string ToString()
		{
			if (m_bNotNull)
			{
				return m_value;
			}
			return "null";
		}

		public static OracleString Concat(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.Concat);
			}
			try
			{
				if (InternalTypes.CompareNull(!value1.m_bNotNull, !value2.m_bNotNull) == CompareNullEnum.BothNotNull)
				{
					if (value1.m_bCaseIgnored == value2.m_bCaseIgnored)
					{
						return new OracleString(new StringBuilder().Append(value1.m_value).Append(value2.m_value).ToString(), value1.m_bCaseIgnored);
					}
					throw new OracleTypeException(ResourceStringConstants.TYP_COMPARE_COLLATION);
				}
				return Null;
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.Concat, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.Concat);
				}
			}
		}

		public static bool Equals(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.Equals);
			}
			try
			{
				return StringCompare(value1, value2) == 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.Equals);
				}
			}
		}

		public static bool GreaterThan(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.GreaterThan);
			}
			try
			{
				return StringCompare(value1, value2) > 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.GreaterThan);
				}
			}
		}

		public static bool GreaterThanOrEqual(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.GreaterThanOrEqual);
			}
			try
			{
				return StringCompare(value1, value2) >= 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.GreaterThanOrEqual);
				}
			}
		}

		public static bool LessThan(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.LessThan);
			}
			try
			{
				return StringCompare(value1, value2) < 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.LessThan);
				}
			}
		}

		public static bool LessThanOrEqual(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.LessThanOrEqual);
			}
			try
			{
				return StringCompare(value1, value2) <= 0;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.LessThanOrEqual);
				}
			}
		}

		public static bool NotEquals(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.NotEquals);
			}
			try
			{
				return !Equals(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.NotEquals);
				}
			}
		}

		public static bool operator ==(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorEqualTo);
			}
			try
			{
				return Equals(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorEqualTo);
				}
			}
		}

		public static bool operator >(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorGreaterThan);
			}
			try
			{
				return GreaterThan(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorGreaterThan);
				}
			}
		}

		public static bool operator >=(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorGreaterThanOrEqualTo);
			}
			try
			{
				return GreaterThanOrEqual(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorGreaterThanOrEqualTo);
				}
			}
		}

		public static bool operator <(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorLessThan);
			}
			try
			{
				return LessThan(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorLessThan);
				}
			}
		}

		public static bool operator <=(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorLessThanOrEqualTo);
			}
			try
			{
				return LessThanOrEqual(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorLessThanOrEqualTo);
				}
			}
		}

		public static bool operator !=(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorNotEqualTo);
			}
			try
			{
				return NotEquals(value1, value2);
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorNotEqualTo);
				}
			}
		}

		public static OracleString operator +(OracleString value1, OracleString value2)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorPlus);
			}
			try
			{
				return Concat(value1, value2);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorPlus, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorPlus);
				}
			}
		}

		public static explicit operator string(OracleString value1)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorString);
			}
			try
			{
				if (value1.m_bNotNull)
				{
					return value1.Value;
				}
				throw new OracleNullValueException();
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorString, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.OperatorString);
				}
			}
		}

		public static implicit operator OracleString(string value1)
		{
			if (ProviderConfig.m_bTraceLevelPublic)
			{
				Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
			}
			try
			{
				return new OracleString(value1);
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Public, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPublic)
				{
					Trace.Write(OracleTraceLevel.Public, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.ctor);
				}
			}
		}

		internal static int StringCompare(OracleString oraStr1, OracleString oraStr2)
		{
			if (ProviderConfig.m_bTraceLevelPrivate)
			{
				Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Entry, OracleTraceClassName.OracleString, OracleTraceFuncName.StringCompare);
			}
			try
			{
				switch (InternalTypes.CompareNull(!oraStr1.m_bNotNull, !oraStr2.m_bNotNull))
				{
				case CompareNullEnum.BothNull:
					return 0;
				case CompareNullEnum.FirstNullOnly:
					return -1;
				case CompareNullEnum.SecondNullOnly:
					return 1;
				default:
					if (oraStr1.m_bCaseIgnored == oraStr2.m_bCaseIgnored)
					{
						return string.Compare(oraStr1.m_value, oraStr2.m_value, oraStr1.m_bCaseIgnored);
					}
					throw new OracleTypeException(ResourceStringConstants.TYP_COMPARE_COLLATION);
				}
			}
			catch (Exception ex)
			{
				OracleException.HandleError(OracleTraceLevel.Private, OracleTraceTag.Error, OracleTraceClassName.OracleString, OracleTraceFuncName.StringCompare, ex);
				throw;
			}
			finally
			{
				if (ProviderConfig.m_bTraceLevelPrivate)
				{
					Trace.Write(OracleTraceLevel.Private, OracleTraceTag.Exit, OracleTraceClassName.OracleString, OracleTraceFuncName.StringCompare);
				}
			}
		}
	}
}
